package com.example.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.example.controller.employee.req.AttendanceReq;
import com.example.entity.BO.AttendanceStatisticBO;
import com.example.entity.BO.ClockDetailBO;
import com.example.entity.BO.TimeValueBO;
import com.example.entity.EmployeeClock;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ChenXiaoBin
 * on 2020-08-18
 */
public interface IEmployeeClockDao extends BaseMapper<EmployeeClock> {

    /**
     * 查询员工打卡记录
     *
     * @param employeeId 员工id
     * @return
     */
    EmployeeClock selectClockRecord(@Param("employeeId") Integer employeeId);

    /**
     * @param req
     * @return
     */
    List<AttendanceStatisticBO> attendance(@Param("req") AttendanceReq req);

    /**
     * 根据日期查询上下班时间
     *
     * @param lockTime
     * @return
     */
    ClockDetailBO selectClockDetail(@Param("lockTime") String lockTime, @Param("employeeId") Integer employeeId);

    /**
     * 统计近七天打卡率
     *
     * @param sql
     * @return
     */
    List<TimeValueBO> getTimeValue(@Param("sql") String sql);
}
